const { createApp, onMounted } = Vue
createApp({
    data() {
        return {
            serchData: '',
            is_show_header_back: false,
            banner_top_back: "rgba(255, 255, 255, 0)",
            is_show_login: true, //是否显示登录
            userInfo: {}, //用户信息
        }
    },
    mounted() {
        window.addEventListener('scroll', this.handleScroll);
    },
    methods: {
        handleSearch() {
            console.log(this.serchData)
        },
        handleScroll() {
            let scrollTop = document.documentElement.scrollTop || document.body.scrollTop; //滚动条滚动高度
            if (scrollTop > 100) {
                this.is_show_header_back = true;
            } else {
                this.is_show_header_back = false;
            }
            // 获取屏幕高度
            let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
            this.banner_top_back = `rgba(255, 255, 255, ${scrollTop / clientHeight})`;
        }
    }
}).mount('#app')